from utils.SendMethod import SendMethod


class Event:
    def __init__(self):
        self.url = "http://127.0.0.1:8000"

    def add_event(self, payload):
        url = self.url + "/api/add_event/"
        method = "post"
        return SendMethod.sendmethod( method=method, url=url, body=payload)

    def get_event(self, params):
        url = self.url + "/api/get_event_list/"
        method = "get"
        return SendMethod.sendmethod( method=method, url=url, params=params)


if __name__ == '__main__':
    body = {
        'eid': 3405,
        'name': '黑米456发布会',
        'limit': 30,
        'status': 1,
        'address': '哪个教室',
        'start_time': '2022-7-30'
    }
    print(Event().add_event(body))
    # params = {
    #     "eid":"3455",
    #     "name":"黑米1011发布会"
    # }
    # print(Event().get_event(params))